﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AudioBook.AudioManagement.Util;

namespace AudioBook.AudioManagement
{
    public partial class NumberToText : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                txtText.Attributes.Add("onclick", "this.select();");
            }
        }

        protected void btnRead_Click(object sender, EventArgs e)
        {
            string result = ReadNumber.Read(txtNumber.Text.Trim()).Trim();
            if (!string.IsNullOrEmpty(result))
            {
                result = result[0].ToString().ToUpper() + result.Substring(1);
            }
            txtText.Text = result;
        }
    }
}
